﻿using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Data;

namespace HobSoft.SoccerBet2014.Common.Wpf.Converter
{
    public class CaseVisibilityConverter : IValueConverter
    {
        public Dictionary<string, Visibility> Case { get; set; }
        public Visibility Default { get; set; }
        public CaseVisibilityConverter()
        {
            Default = Visibility.Visible;
            Case = new Dictionary<string, Visibility>();
        }
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value == null) return Default;
            if (Case == null) return Default;
            
            string enumString = value.ToString();
            if (Case.ContainsKey(enumString))
            {
                return Case[enumString];
            }
            return Default;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
